cmake_minimum_required(VERSION 3.21.2)

execute_process(COMMAND gcc -dumpfullversion -dumpversion OUTPUT_VARIABLE GCC_VERSION)
#message(STATUS "gcc version = ${GCC_VERSION}")

if (GCC_VERSION LESS "4.9.3")
    message(FATAL_ERROR "gcc version need greater than 4.9.3")
endif()

project(vector_data_generator)
execute_process(COMMAND git log -1 --pretty=format:%h . OUTPUT_VARIABLE version)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -g -O2 -lrt -Wall")

aux_source_directory(./  SRC_FILES_FUNC)

link_directories(
    ${PROJECT_SOURCE_DIR}/../../../../3rdlib/jsoncpp/lib
)

add_executable(vector_data_generator  ${SRC_FILES_FUNC})

target_include_directories(vector_data_generator PUBLIC
    ${PROJECT_SOURCE_DIR}/../../../../3rdlib/jsoncpp/include
)

add_definitions(-DACTIVE_GIT_VERSION="${version}" -DMAIN)

target_link_libraries(vector_data_generator PRIVATE jsoncpp ssl pthread dl)
set_target_properties(vector_data_generator PROPERTIES RUNTIME_OUTPUT_DIRECTORY "../../bin")
